/**
 * $Revision: 1.0 $
 * $Author: Eric Yang $
 * $Date: Dec 23, 2009 11:33:55 PM $
 *
 * Author: Eric Yang
 * Date  : Dec 23, 2009 11:33:55 PM
 *
 */
package com.gooex.web.action.gbuy.order;

import java.math.BigDecimal;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.gooex.domain.base.OrderQuote;
import com.gooex.service.base.exception.ExceptionCode;


/**
 * @author Eric Yang
 * @version 1.0
 */
public class QuoteAction extends BaseOrderAction {
	private static final Log logger = LogFactory.getLog(QuoteAction.class);

	private String quoteId;

	private BigDecimal amount;

	private BigDecimal carriage;

	private String msg;

	private String result;

	public String setQuoteInfo() throws Exception {
		OrderQuote quote = orderManager.getObject(OrderQuote.class, quoteId);
		if (quote == null) {
			msg = ExceptionCode.SYSTEM_ACCESS_ERROR;
			logger.error(msg);
			result = "error";
		} else {
			quote.setAmount(amount);
			quote.setCarriage(carriage);
			orderManager.saveOrUpdate(quote);
			msg = "success";
			result = "success";
		}
		return SUCCESS;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public BigDecimal getAmount() {
		return amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	public String getQuoteId() {
		return quoteId;
	}

	public void setQuoteId(String quoteId) {
		this.quoteId = quoteId;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public BigDecimal getCarriage() {
		return carriage;
	}

	public void setCarriage(BigDecimal carriage) {
		this.carriage = carriage;
	}
}
